package com.itelite.mapper;

import com.itelite.domain.dto.Diversion;
import com.itelite.domain.dto.UploadUser;
import com.itelite.domain.dto.UserVo;
import com.itelite.domain.pojo.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author 沈洋 邮箱:1845973183@qq.com
 **/
@Mapper
public interface UserMapper {
    User queryUserByUsername(String username);
    UserVo queryUserVoByUserId(Integer userId);

    String queryUserPassword(Integer userId);

    Integer insertUser(List<UploadUser> list);
    @MapKey("userId")
    List<Map<String, String>> queryUserByKeyword(String keyword);

    void updateUserRole(String role, @Param("leaderId") Integer[] leaderId);

    Integer updateUserPassword(@Param("userId") int userId, String password);

    List<User> queryUserByEmail(String email);

    Integer deleteLeader(Integer userId);

    Integer deleteUser(Integer userId);

    Integer updateUser(UserVo user);

    Integer updateUserGroupId(Diversion diversion);

    Integer countUserByEmail(String email);

    void abandonedGroupUser(@Param("groupIds") Integer[] groupIds);

    void updateUserEmail(Integer userId, String email);
    List<UserVo> selectAllUser();
}
